package com.warmlight.voicepacket.plugin;

/**
 * Created by weiweijinpeng on 2018/7/25.
 */

public class QmzbVideoPlayerManager {

    public static QmzbVideoPlayer FIRST_FLOOR_JZVD;
    public static QmzbVideoPlayer SECOND_FLOOR_JZVD;

    public static QmzbVideoPlayer getFirstFloor() {
        return FIRST_FLOOR_JZVD;
    }

    public static void setFirstFloor(QmzbVideoPlayer qmzbVideoPlayer) {
        FIRST_FLOOR_JZVD = qmzbVideoPlayer;
    }

    public static QmzbVideoPlayer getSecondFloor() {
        return SECOND_FLOOR_JZVD;
    }

    public static void setSecondFloor(QmzbVideoPlayer qmzbVideoPlayer) {
        SECOND_FLOOR_JZVD = qmzbVideoPlayer;
    }

    public static QmzbVideoPlayer getCurrentJzvd() {
        if (getSecondFloor() != null) {
            return getSecondFloor();
        }
        return getFirstFloor();
    }

    public static void completeAll() {
        if (SECOND_FLOOR_JZVD != null) {
            SECOND_FLOOR_JZVD.onCompletion();
            SECOND_FLOOR_JZVD = null;
        }
        if (FIRST_FLOOR_JZVD != null) {
            FIRST_FLOOR_JZVD.onCompletion();
            FIRST_FLOOR_JZVD = null;
        }
    }
}
